import os
from common.set_url import write_to_file_method1
from ddt.excel_ddt import conf

if __name__ == '__main__':
    # # 设置测试环境
    test = "http://scm-test1.yizheyun.cn"
    pre = "https://scm-pre.yizheyun.com"
    pro = "https://scm.yizheyun.com"
    write_to_file_method1(pre)
    os.system('rd /s/q Webresult')
    os.system('rd /s/q Webreports')
    root_dir = os.path.abspath(os.sep)
    path = "Myframe/ddt"
    img_list = os.listdir(root_dir + path)
    print(img_list)
    for i in range(len(img_list)):
        if img_list[i].startswith("test") and img_list[i] != "test_App.py":
            print(img_list[i])
            os.rename(f'./ddt/{img_list[i]}', './ddt/test_web.py')
    conf.runCase(case_file='testWebCases/test8.xlsx')
    os.system('allure generate Webresult -o Webreports --clean')